1. Field of the Invention
The present invention relates to an image processing apparatus, an image processing method, and a computer-readable recording medium for detecting a contour edge of a target object from a target image.
2. Description of the Related Art
In general, edges in an image are detected by detecting positions where gradients largely change. Basically, edges are detected by calculating gradient magnitudes from gradients of luminance values in an image and performing thresholding on the gradient magnitudes. Various detailed techniques have been developed, and as one of these techniques, Canny edge detection algorithm is known (see Canny edge detector, J. Canny, “A Computational Approach to Edge Detection”, IEEE Trans. on Pattern Analysis and Machine Intelligence, 8(6), pp. 679-698, 1986). Japanese Laid-open Patent Publication No. 2007-140684 discloses a method of detecting edges while suppressing noise edges. In Japanese Laid-open Patent Publication No. 2007-140684, luminance gradient values in four directions are calculated, and a first gradient value corresponding to a direction of an edge and a second gradient value corresponding to a direction perpendicular to the edge are estimated on the basis of the magnitudes of the luminance gradient values in the four directions. Thereafter, a relative magnitude of the first gradient value to the second gradient value is obtained as edge strength in order to discriminate an edge caused by a structure of a target object from an edge caused by noise. Japanese Laid-open Patent Publication No. 07-225847 discloses processing of detecting a contour edge of a target object. In Japanese Laid-open Patent Publication No. 07-225847, a thick rough contour line is input for a target object of which contour is to be extracted, and the greatest gradient magnitude is repeatedly traced by taking a pixel position with the greatest gradient magnitude as a start point within the thick rough contour line, so that a contour line is extracted.